import request from '../utils/request'

export function getVideoList(uid,page,page_size){
  return request.get('video/videoList?uid='+ uid +'&page='+page+'&page_size='+page_size)
}

//获取自己的视频
export function getMineVideo(page,page_size){
  return request.get('video/mine?page='+page+'&page_size='+page_size)
}

//修改视频信息
export function modifyMyVideo({id,title,content,isShow}) {
  return request.post('video/modify',{id,title,content,isShow})
}

//获取推荐视频
export function getRecommendList(page,page_size){
  return request.get('video/getRecommend?page='+page+'&page_size='+page_size)
}

export function getPopularList(){
  return request.get('video/popular')
}

export function getVideoInfo(vid){
  return request.get('video/videoInfo?vid='+vid)
}

//删除
export const deleteVideo = ({id}) => {
  return request.post('video/delete',{id})
}

//获取点赞收藏信息
export const likeInfo = (vid) => {
  return request.get('interactive?vid=' + vid)
}


//点赞
export const like = ({id}) => {
  return request.post('like/add',{id})
}

//取消赞
export const dislike = ({id}) => {
  return request.post('like/cancel',{id})
}

//收藏
export const favorites = ({id}) => {
  return request.post('favorites/add',{id})
}

//取消收藏
export const unfavorites = ({id}) => {
  return request.post('favorites/cancel',{id})
}

//获取收藏的视频
export const getFavorites = (page,page_size) => {
  return request.get('favorites/get?page='+page+'&page_size='+page_size)
}
